package org.frog.sgs.client.process;

import java.util.HashMap;
import java.util.Map;

import org.frog.sgs.client.process.all.ClientProcessorChooseGeneral;
import org.frog.sgs.client.process.all.ClientProcessorChooseRole;
import org.frog.sgs.client.process.all.ClientProcessorShowZhuGong;
import org.frog.sgs.client.process.all.ClientProcessorSyncAllCharacterInfo;
import org.frog.sgs.client.process.all.ClientProcessorSyncCharacterInfo;
import org.frog.sgs.client.process.all.ClientProcessorSystemAll;
import org.frog.sgs.client.process.all.ClientProcessorWuXieKeJiAsk;
import org.frog.sgs.event.SgsEventCode;

/**
 * @author duanxiangqi
 * @date 2012-10-26
 */
public enum ClientProcessorManager {
	instance;

	private Map<Integer, ClientProcessor> processors = new HashMap<Integer, ClientProcessor>();
	{
		processors.put(SgsEventCode.SYSTEM_ALL_EVENT, new ClientProcessorSystemAll());
		processors.put(SgsEventCode.CHOOSE_GENERAL, new ClientProcessorChooseGeneral());
		processors.put(SgsEventCode.CHOOSE_ROLE, new ClientProcessorChooseRole());
		processors.put(SgsEventCode.SHOW_ZHUGONG, new ClientProcessorShowZhuGong());
		processors.put(SgsEventCode.SYNC_CHARACTER_INFO, new ClientProcessorSyncCharacterInfo());
		processors.put(SgsEventCode.SYNC_ALL_CHARACTER_INFO, new ClientProcessorSyncAllCharacterInfo());
		processors.put(SgsEventCode.WU_XIE_KE_JI_ASK, new ClientProcessorWuXieKeJiAsk());
	}

	public ClientProcessor getProcessor(int code) {
		return processors.get(code);
	}

	public Map<Integer, ClientProcessor> getProcessors() {
		return processors;
	}

	public void setProcessors(Map<Integer, ClientProcessor> processors) {
		this.processors = processors;
	}
}
